package com.bjsxt.recuesion;

import java.io.File;

public class Test {
    public static int num=10;
    public static void a(){
        num--;
        System.out.println("Test.a:"+num);
        if (num>0){
            a();
        }

    }

    public static void b(){
        System.out.println("Test.b");
    }

    public static long factorial(int n){
        if (n==1){
            return 1;
        }else {
            return n*factorial(n-1);
        }
    }

    static void printFile(File file, int level){
        for (int i=0;i<level;i++){
            System.out.print("-");
        }
            System.out.println(file.getName());
            if (file.isDirectory()){
                File[] files = file.listFiles();
                for(File temp:files){
                    printFile(temp,level+1);
                }
            }


    }

    public static void main(String[] args) {
        a();
        System.out.println(factorial(3));
        File files= new File("/home/xiaodiyang/job/javaStudy/java300");
        printFile(files,0);
    }



}
